import Layout from './components/Layout'
import Login from './pages/Login'
import Register from './pages/Register'
import Home from './pages/Home'
import Shop from './pages/Shop'
import Treasure from './pages/Treasure'
import GoodPre from './pages/GoodPre'
import GoodBuy from './pages/GoodBuy'
import GoodTreasure from './pages/GoodTreasure'
import WinnerHistory from './pages/WinnerHistory'
import UserCenter from './pages/UserCenter'
import Setting from './pages/Setting'
import OrderList from './pages/OrderList'
import PrizeList from './pages/PrizeList'
import UserDetail from './pages/UserDetail'
import MessageList from './pages/MessageList'
import Pay from './pages/Pay'
import PayTreasure from './pages/PayTreasure'
// 首页
import MainPage from './pages/MainPage'
// 购物车
import shoppingCart from './pages/shoppingCart'

export default [{
        path: '/',
        component: Layout,
        redirect: '/login',
        children: [{
                path: '/home',
                name: 'home',
                component: MainPage
            },
            {
                path: '/shoppingcar',
                name: 'shoppingcar',
                component: shoppingCart
            },
            {
                path: '/good-pre/:id',
                component: GoodPre
            },
            {
                path: '/shop',
                name: 'shop',
                component: Shop
            },
            {
                path: '/good-buy/:id',
                component: GoodBuy
            },
            {
                path: '/treasure',
                name: 'treasure',
                component: Treasure
            },
            {
                path: '/good-treasure/:id',
                component: GoodTreasure
            },
            {
                path: '/winner-history/:id',
                component: WinnerHistory
            },
            {
                path: '/user-center',
                name: 'usercenter',
                component: UserCenter
            },
            {
                path: '/setting',
                component: Setting
            },
            {
                path: '/order-list',
                component: OrderList
            },
            {
                path: '/prizes',
                component: PrizeList
            },
            {
                path: '/user-detail',
                component: UserDetail
            },
            {
                path: '/messages',
                component: MessageList
            },
            {
                path: '/pay',
                component: Pay,
                props: route => {
                    return {
                        sn: route.query.sn,
                        price: route.query.price,
                        number: route.query.number
                    }
                }
            },
            {
                path: '/pay-treasure',
                component: PayTreasure,
                props: route => {
                    return {
                        sn: route.query.sn,
                        price: route.query.price,
                        number: route.query.number
                    }
                }
            },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/register',
        component: Register
    }
]